Set ANSI_NULLS ON
Set QUOTED_IDENTIFIER ON
GO

/*Drop stored procedures if they exists */

IF EXISTS (SELECT name FROM sysobjects WHERE name = 'verificarDireccionEditarBodega' and type = 'P')

	BEGIN
		DROP PROCEDURE verificarDireccionEditarBodega
	END

GO

CREATE PROCEDURE verificarDireccionEditarBodega ( @nombreBodega VARCHAR (30) ,
												  @idBodega INT , 	 
												  @outParam INT OUTPUT						
												)
AS

	DECLARE @out AS INT;
	SET @out = -1;
	
	SELECT @out = BODEGA.IDTIPOBODEGA 
	FROM BODEGA 
	WHERE BODEGA.NOMBREBODEGA = @nombreBodega AND BODEGA.IDBODEGA = @idBodega;	 
	
	SET @outParam = @out;

	SELECT @outParam;
GO